break out resolver and NewClosure into their own libs