converted to case classes