clean up dirty __import__ code