update and clean up repository