Simplification of the code, removal of dead imports.