Separating search function into different file