Shorter methods

Refactorings to get rid of the longest methods.