working on factoring apart gen-all.
more refactoring