adjusted data structures to isolate immutable parts