fix range parsing bug, reorganized event data formatting code, etc