lgrngn API: making factory a function