event refactoring and goroutines for easier expansion