Extracted function so that we can track files in other functions