refactoring handler