Factored out more update functions from the rendering loop