A bit more pythonic and thread safe :)