generics refcatoring