Code refinement. And added interface for DomainEventPublisher so, that it can be mocked easily in unit testing.