cleanup up some event handler code, fixed up layout, added some color

Signed-off-by: Anton Chan <antoniuschan99@gmail.com>