Refactor fileInput