big factorization in c_popup_read_dir_action class