add sync progressbar and a small refactoring