Add context managers and release objects when finished