cleanup

Just some clean up stuff including:
- removing unnecessary imports (some of the imports for classes were changed to single class imports, even though i prefer it that way, but tried to avoid doing this as it would make the diff messier, but sometimes it still happened due to my IDE)
- removing unnecessary casting
- removing unnecessary logic checks
- removing unused variables
If 'contentType' is null, it will encounter a Null Pointer Exception here due to the && which is the reason for changing this part