refactoring. dryer Renderer.java