changes as Raphy suggested in code review