Add clear button for search box
Some code cleanup