Moved utility methods out of Renderer