refactor all the classes