better d3 handling