ical_dezonify: rearranged code and added log output