Render refactor (with couple of fixes)

This small enough to be inline.