refactoring the ad7 debugger