Payday rewrite, part 5

Step 6 of #2508. Follow-on from #2541.