Refactored Inheritance and Polymorphism

TODO: documentation