Optimized generation transaction building. Should be a bit faster.