Move saving data to separate class.