Make dependency on localStorage optional