Move data reading into separate file