refactor to eliminate duplicated code?

```scala
def checkConsistencyThen(f: (Timestamp, Message) => Record): Record = {
  consistencyError match {
  ...
   }
}
```