I did not use contextlib because the implementation required some kind of setup of the object so that it  remembered its configuration (reason why all those `self` references in `__call__`. 

If the use of contextlib was the only way I guess I would need to implement closures here which I don't like to use unless it is absolutely necessary as it makes it a challenge to properly test them