Refactor the class structure.