finish whitespace changes and code cleanups