Convert any class to model