Removing unwanted imports and variables