Reverted deletion of event setup code