Convert case classes to case objects