refactor, rename parsePayload, udpate tests