refactor of the render engine for doc form