moved search stuff out to seperate module