please separate this block in an external function.