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
profileIdentifier will always not be null here due to the 'if statement' right before this one, so removed this check