added persistent storage data layer plus refactoring and UI improvements