Add edit functionality in the ui.
Refactor search listener