Refactor to use stateless session