fileProvider: refactor code.