refactoring rendering of models