d3 refactor for pres