Improved class extension example