Refactoring: extract methods