Using inheritance and polymorphism.