refactoring: extract method