remove need for pattern matching for .done events
write emitting the close of the root in a more compact way
update built code. passing all tests
improved naming in source