Began modularisation, starting with payload.js and half of helpers.js