Clean up and small refactoring for more OO