progressDialog refactoring