Search suggestions: some code refactor