Some refactoring in the MainActivity and Storage classes.