Breaking the read into a seperate function make it look cleaner