refactoring of methods