Payday rewrite, part 3

Step 4 of #2508. Follow-on from #2539.