Refactored file descriptors to use a structure.