Uniformize code for search