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