some refactoring and removed unused file