Refactor sessions