This is code which I needed in our use-case. 
I will remove it momentarily.