Use toId rather than replace and toLowerString

toId achieves the same in one single line and better.