move FileReference to the correct place, closes #2907 #4781