moving common functionality to mamba