micro fix for generate to be more efficient