Uses generics instead of raw types
Minor improvements.
Revert "Delete unused classes, methods, fields and variables."

This reverts commit f60904a6c146874b75857918c40410c0faa07c69.
Fixes minor import issue