Overall and local distortion effects on the metal–nonmetal transitions of mixed valent perovskite type manganese oxides