Refactoring to make more readable generated methods