Imrpove namespace matching