Refactored to create the base of a rendering engine.