This comparison is repeated...extract as a variable?