optimized imports and refactoring