* Move nesting generator to separate class * Major bug fix, code simplification * Get rid of global value, use class variable instead.