use OO and polymorphism to branch on