refactor BasicRenderEngine.as