Refactoring refund logic, fixing tests