more refactoring
pyramid is generated, but we are crashing on pyramid dtor, still investigating...