more refactoring of the model