some updates following leeat's comments