fixed the underlying data structures of cpp classes