Refactored: payload to json