Added initializeEvents method