Refactoring code
Fixed statusbar blinking