refactoring, more object orientation