refactor calculate discount policy