Stricter simulation of a with statement