clean up code and delete duplicate files