avoid concatenation when possible in generator