clean up, and some file mgmt