refactoring and methods