Refactored lock disposal