Render refactor (with couple of fixes)

yes, it can be moved there