Pulled this out into a separate method.