started decoupling domain from event processing - refactoring switch-loop