Some cleanup to make this easier to script