perf(util): call toLowerCase() only where needed

There is no need to lowerCase all parts as we'll capitalize them later. Marginally faster.