Refactor function file.create().