This deeply nested literal renderer is badly expressed and should be written as a standalone global function