Build some data structures.