Remove unused imports.
Improve type checking.
Add some @SuppressWarnings annotations.