improve separate_first_last after use