lots of closure-related changes