Refactor deinit_temporary_content