define NFA, remove cyclic dependencies