a few imporvements inspired from DM conf