Refactoring save by session id