Refactored imports handling.