refactoring class methods