refactoring and removed unnecessary classes