refactor usage of RenderContext