merged with bt_setup.c without compilation errors