core.py: further improvement for json imports