Jkarni/cleanup

Sundry cleanup and stylistic changes.