Code quality improvements
More effective generation of random strings
Refactor session ID generation