calendar edit, code cleanup