Refactored code. Subclass example working.