Move file reading out into separate class