Structural and Functional Characterisation of partner switching regulating the environmental stress response in Bacillus subtilis