Factor out reactive function which gets files