small simplifications

We can shrink the code a bit and make it easier to follow.