just `return exports` would do, and then you can move the code from 'chart' into the top of 'exports', you can then move `var self` to point at the outer object, and use 'exports' to point at the publicly exposed fields.