add swap_dic and file_to lines helpers