make event.calendar nullable and remove some useless code