can we pull these objects out so 1) they don't need to be recreated on every `data` event and 2) this piece of code data-handler would be more readable?