minor refactoring for models in views