trusted_server refactor; more examples; utils for common logic