Refactor magic methods example.