Extract a helper method