Feels like this should just be folded into the generate_payload method