reducing the branch to a minimal finalize() hook introduction