Refactoring of CompoundState model to avoid holding all internal states and transitions in it.