Improved logging. Optimized sessions