wrap global io dependency in factory