Added a register_handlers function