PERF: avoid string allocations

I am pretty sure this is correct, its also more explicit about the behavior here.