Smarter variable bindings and cleaning