Render refactor (with couple of fixes)

Perhaps, but that should be another change.