Refactors class structure