Fix discounts not working
Refactoring