refactor the code and add PushPayload