Replaced Type Code With Polymorphism