refactor and add Session table