Extracted reading and writing into a pickle into a seperate file