Refactor common code out of Payments