remove debug code
rewrite with the data structure as a plain object
rewrite as chainable object