A bit of restructuring using pointers instead of full structs.