Function pointers and polymorphism (Bad design)