use tr instead of gsub when possible

`tr` is over 5x faster than gsub. Also `tr` is the concise idiomatic method call you do for that kind of things