Rework to centralise all file reading