add generics in getBatchByNames