improve file module with promise