pre-branch cleanup