refactoring for update statusbar