partially done, see  a27f6d1