Refactor serialization spec helper for clarity.