fix mkdir ep-prefix directories problem, code beautifuling