State machine with parameterization - in progress