FLUID-5276: Simplify the binding of the close handler