Merge "Factor out helper method."