Added more intelligence to namespace filter and to migration task