Add search form, refactor the code and other