some cleanups to the view handler callbacks

Mostly reformatting to help read and scan more easily.