Implement more sophisticated event system