introducing more strict check on state/event definitions