refactor quantity discount