Changed case objects back to case classes.