refactoring payments