delete unused file and some refactoring