refactoring code in SearchTitleActivity