refactor typerenderer