refactoring rendering