Make cb attaching more flexible