Optimize imports (remove unused imports and organize via PEP8)