Removing duplicated and unused imports and variables.