replacing the conditional logic on price code with polymorphism