Refactored the generation of the BedRest request into its own factory