Some improvements of the previous commit