cleanup extra whitespace and other things