Looking at things now, though, you're right that it's likely that it's safe to remove both of the loops.