Converted to Mako templates