convert things to case classes