search code relocated into a dedicated class