add generics and parameters, update codes