code refactoring and status bar z-index fix, close #2