This is called twice, so memoize it.