Program structure changes

Stability fixes