Somewhat simplified render code.