API change - pass object to genplate instead of a function