Refactor _payload handling. Closes #1215