FIX: split setup_fn and teardown_fn to get a cmd array