Refactor - columns_to_next_tab function