On the Design of Hierarchies: Coordination Versus Specialization