this was meant to be split into smaller changes, but I realised I edited my existing revision too late.