refactor and clean code in all classes