cleaning the code, refactoring classes