Code cleanup

Code cleanup.
Just removal of unnecessary casts, unnecessarily nested else clauses, unused imports and incorrect @Override annotations