1. refactoring should be done separately
2. I don't see that early returns would make it clearer than careful formatting