re-factored weird construct in MarshallerPlugin