Extract

Third try.
This should really be the correct one to replace #1927