refactoring method