Added support for optional payload parameters.