functions: Replace inline templates with network functions.