clean up code
refactor Debug out of d3