Better logic, clean useless code and adding file status into status bar