move search method into it's own script