Render refactor (with couple of fixes)

Maybe it's not that important...