Refactor the file manager component