Fixed with PR comments regarding test case and event order.

Do we need the factory pattern thing in this PR itself?