Applied lookup optimisation by removing a unnecessary call to sort by length method