Template: factor out things for dynamic template functions.
Fix visuals, output maxpoints