Refactor and fix bug with payload meta.