refactoring and preparation for new tests