Refactoring of session logging and process managamenet.