move the rebuild import to core.py