Improved approach for persisting objects.