Refactored localStorage to separate module