Remove unnecessary object copying and regex allocations.