Refactor session state validator to support serialization