refactor deadlocks module