Partial refactor for wit_session