Looks like a candidate for extracting to a helper method