OO refactoring needed for fragments to work