some refactoring introducing traits