search: code cleanup