Some cleanup to nade code