cleanup and fixes some generics
further generics fixes