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, wouldn't the statement short circuit at the && and therefore not evaluate any of the other contentType statements?