Remove unused imports and correct some java generics