You could probably pull this if statement into a separate method to clean up this code a tiny bit.