Some improvements of current code