Improved primitive generation