Convert models to classes