factor out UI.render from UI.materialize