make factories an array instead of map