Bugfix on recent commit that caused warnings
More OO refactoring; hopefully lower complexity in existing files