template resolver for device and agent