Reorganize class structure