conditional protocol depending on env