fix pdef template maker as class method