added generics support