Remove unused files and clean up code