Better handling of 'client' in disposer function