WIP: improve instance.py