refactor search on calendar