Improve io.py