Refactor to add more reusable code. Add user autocomplete search