So does this same code exist in other places (linkes 563-568)? If so, please refactor to create a helper method.