Building application-specific domains using templates