Cleanup of dead code and whitespace