Refact class structure