refactoring styles out of d3 js