These 5-10 lines repeat a bit, might be worth a method.