Incomplete refactor to help better test due randomization.