auto convert to rest classes