Extracted a helper method