paranoid commit: generalising functions part 1