Remove legacy code and whitespace