removing unused file and moving new file to appropriate directory