Refactor dropdown code. Add message when no results are found