rewrite some import logical control