Use record accessors rather than pattern matching