Factor out some common logic between fdesc and desc