refactor facility search controller