Implement functionality for persistence to disk