Refactoring for handlers.