Remove the globals in search