Removes unneeded methods and imports