refactor NVD3class