This almost duplicated with line 44 till 54, is it needed for usage of the search form outside the admin?