Refactor to use SessionStorage