Modify UniqueFileFactory to support easy testing