Clean up of whitespace and unused code