code cleanup
now uses /tmp folder for storing update state