refactor to use SCXML files