helper functions for localStorage