Render refactor (with couple of fixes)

Also, is the `!visible` check correct? Only part of the if that hasn't been inverted.