Micro optimizations

Get rid of unnecessary regex