Refactoring to use try/finally to release the locks