refactoring handlers methods.