refactored and added to model tests