some refactoring as discussed this wednesday