conditional logic to polymorphysm