They were subject to co-ordination by inspectors of the security police and SD on the staffs of the local higher SS and police leaders, however, and one of the principal functions of the local SD units was to serve as the intelligence agency for the local Gestapo units. In the occupied territories, the formal relationship between local units of the Gestapo, criminal police, and SD was slightly closer.[81]