Update appdatainfo.py

Refactor and cleanup code