refactoring handlers