Refactor content_history_init/deinit