Extract common code from Command and Event into CoreClass