events design and clean code