some refactoring with new objects