trying to use polymorphism instead of switches. not going too well.