refactoring handlers and constants