Refactoring for smaller methods