Convert connection state to struct
Convert records to structs