Some improvemetns (to be squashed before merge)