Refactor debugging.