[misc] Fixed typo
Introduce generics
+ deleted unused variables