Moving toward a better state/module machine