Replace try/finally with with-block