Actually, I now noticed that the same code is duplicated on line 40 below. Where possible, you do want to avoid this sort of duplication; I think a method would be warranted here.