Cleaned up saving to file code