refactor and add statusbar