Tiny refactor of rendering