Refactoring class definition

WIP