improvements to handler callbacks