Removed unused imports, unreachable code and unneeded whitespace