temporarily moved rendering to example to see patterns for refactoring