Extract perform_fit() and perform_segment()