refactor remote debugger