Refactor web storage example