refinement: extract ui manager and rendering.