Updated some of the rendering code to be more modular.