fixed several files and delete unused ones