Making setup changes and sorting the payload for OAuth