import: proper cleanup before import