Handler refactoring