to_ical refactoring

as suggested by untitaker