Refactor to not interact with session