Refactor MockSession