Debug hooks cleaned up

Cleaned up debug hooks - broken into handler functions