restructure classes, prepare for mean-field code