Do we need the first part of this if? It tests the same thing as the if above it? Feels like perhaps this could be refactored?