Moved directiveToServerEvent to a new class (as a static method)