improve generics
finish cleanup