Refactor magic methods example.
Add inheritance example.