Event implementation and tests