Cleaned up storing and loading data from localStorage