added d3service factory and minor formatting