separated debug init code from event init code
minor reformatting