Refactoring toward smaller methods