state: renamed OnExit => OnLeave
added configuration and onenter+onleave