Refactor classes

WIP