Need to figure out hjow factories should return functions with parameters
Works for first depth, perhaps can work with array search and replace