     log "BreakpointManager.removeBreakpoint #{index}"
     @breakpoints.splice index, 1
     @onRemoveBreakpointEvent.broadcast breakpoint
-    @detachBreakpoint breakpoint, 'removed'
+    @detachBreakpoint breakpoint.id
+    breakpoint.dispose()
 
   addBreakpoint: (editor, script, line) ->
     log "BreakpointManager.addBreakpoint #{script}, #{line}"
-    breakpoint =
-      script: script
-      line: line
-      marker: null
-      editor: editor
-      id: null
+    breakpoint = new Breakpoint(editor, script, line)
     log "BreakpointManager.addBreakpoint - adding to list"
     @breakpoints.push breakpoint
-    log "BreakpointManager.addBreakpoint - adding default decoration"
-    @decorateBreakpoint breakpoint
     log "BreakpointManager.addBreakpoint - publishing event, num breakpoints=#{@breakpoints.length}"
     @onAddBreakpointEvent.broadcast breakpoint
     log "BreakpointManager.addBreakpoint - attaching"

NodeDebuggerView = require './node-debugger-view'
jumpToBreakpoint = require './jump-to-breakpoint'

log = (msg) -> # console.log(msg)

class ProcessManager extends EventEmitter
  constructor: (@atom = atom)->

        condition: breakpoint.condition
      }, (err, res) ->
        log "BreakpointManager.attachBreakpoint - done"
        if err
          breakpoint.clearId()
          reject(err)
        else
          breakpoint.setId(res.breakpoint)
          resolve(breakpoint)

  detachBreakpoint: (breakpointId) ->
    log "BreakpointManager.detachBreakpoint"
    self = this
    new Promise (resolve, reject) ->
      return resolve() unless self.client
      return resolve() unless breakpointId
      log "BreakpointManager.detachBreakpoint - client request"
      self.client.clearBreakpoint {
        breakpoint: breakpointId
      }, (err) ->
        resolve()

  tryFindBreakpoint: (script, line) ->
    return { breakpoint: breakpoint, index: i } for breakpoint, i in @breakpoints when breakpoint.script is script and breakpoint.line is line

class Debugger extends EventEmitter
  constructor: (@atom)->
