Refactor everything into a more OO design