clean up calendar code