The top code is temporary, this is less so, but we might be able to use the run in subprocess trick to remove it...