Some cleaning done and progress dialog added