Refactoring and deleting some classes