Entities to case classes