Bluescreen: some logic moved from template to render()