class based magic