Refactor preparatory to implementing random play.