refactor code and correct huge file name errors