refactoring (extract renderer)