Fixing bug when reading sessions and refactoring _ mixin code