Improve events and tests