move data structs closer to usage