refactor message template
refactor search with error