refactor in dissect_filename