Refactored out low level rendering code