Helper functions for data loading and saving. solves # 15