rework of program state structure. Now it is worth its name