Some major Renderer code refactoring