STAT and STAT_SEQ recursion fix + other factoring