RF: change cost2thresh to use slice_data functionality in an effort to remove code duplication