better ajax search handling
more dry