Refactor to use Session.