If this code is trying to do the same thing as line 632, make it a method and use it in both place.