Return the correct factory