magic class definition