finalized and thread-safe