Refactored RenderEngine and added test case class.