Rewrote session related interface.

Minimal class enhance code readability.