Simpliefied the generation of path and name