refactor _setStorage method