Render refactor (with couple of fixes)

ok, i'll remove it