Refactor handler handling
Support handler addition and removal