refactor payments