Added classes to handle database events.