partial re-write of main model classes, not yet integrated into system