code reorganization
spin progress bar on refresh