Remove code duplicates from Debugger