Optimising search functions.