OO refactor and better organisation