Improve render context initialization