Exchanging var by let where possible