Refactor session model