         cumonth = day[1]
 
     for commit in @commits
-      x = offsetX + 20 * commit.time
-      y = offsetY + 10 * commit.space
-      # Draw dot
-      r.circle(x, y, 3).attr(
-        fill: @colors[commit.space]
-        stroke: "none"
-      )
-
-      # Draw lines
-      for parent in commit.parents
-        parentCommit = @preparedCommits[parent[0]]
-        parentX = offsetX + 20 * parentCommit.time
-        parentY1 = offsetY + 10 * parentCommit.space
-        parentY2 = offsetY + 10 * parent[1]
-        if parentCommit.space is commit.space and parentCommit.space is parent[1]
-          r.path(["M", x, y, "L", parentX, parentY1]).attr(
-            stroke: @colors[parentCommit.space]
-            "stroke-width": 2
-          )
-
-        else if parentCommit.space < commit.space
-          if y is parentY2
-            r.path(["M", x - 5, y, "l-5,-2,0,4,5,-2", "L", x - 10, y, "L", x - 15, parentY2, "L", parentX + 5, parentY2, "L", parentX, parentY1]).attr(
-              stroke: @colors[commit.space]
-              "stroke-width": 2
-            )
-
-          else
-            r.path(["M", x - 3, y - 6, "l-4,-3,4,-2,0,5", "L", x - 5, y - 10, "L", x - 10, parentY2, "L", parentX + 5, parentY2, "L", parentX, parentY1]).attr(
-              stroke: @colors[commit.space]
-              "stroke-width": 2
-            )
-
-        else
-          r.path(["M", x - 3, y + 6, "l-4,3,4,2,0,-5", "L", x - 5, y + 10, "L", x - 10, parentY2, "L", parentX + 5, parentY2, "L", parentX, parentY1]).attr(
-            stroke: @colors[parentCommit.space]
-            "stroke-width": 2
-          )
-
-      @appendLabel x, y, commit.refs  if commit.refs
-
-      # Mark commit and displayed in the center
-      if commit.id is @options.commit_id
-        r.path(["M", x, y - 5, "L", x + 4, y - 15, "L", x - 4, y - 15, "Z"]).attr(
-          fill: "#000"
-          "fill-opacity": .7
-          stroke: "none"
-        )
-
-        scrollLeft = x - graphWidth / 2
-
-      @appendAnchor top, commit, x, y
+      x = @offsetX + 20 * commit.time
+      y = @offsetY + 10 * commit.space
+
+      @drawDot(x, y, commit)
+
+      @drawLines(x, y, commit)
+
+      @appendLabel(x, y, commit.refs)  if commit.refs
+
+      @appendAnchor(top, commit, x, y)
+
+      @markCommit(x, y, commit, graphWidth)
 
     top.toFront()
-    @element.scrollLeft scrollLeft
+    @element.scrollLeft @scrollLeft
     @bindEvents()
 
   bindEvents: ->

    )
    top.push anchor

Raphael::commitTooltip = (x, y, commit) ->
  boxWidth = 300
  boxHeight = 200

    for day, mm in @days
      if cuday isnt day[0]
        # Dates
        r.text(@offsetX + mm * 20, 31, day[0])
          .attr(
            font: "12px Monaco, monospace"
            fill: "#DDD"
