I might still add some more changes here, but this might be an interesting point to have a look at it.