Better logic in CreatePayload