Refactoring du lock