Improved structure generation, mostly performance