refactor genericType