Remove 'submachine' package, implement Stateful base class