refund refactoring