can the inner block be a method? It could be resused on line 351 too.