
69 Md. App. 664 (1987)
519 A.2d 760
THE TRAVELERS INDEMNITY COMPANY
v.
INSURANCE COMPANY OF NORTH AMERICA, ET AL.
No. 472, September Term, 1986.
Court of Special Appeals of Maryland.
January 9, 1987.
Kevin M. Murphy (L. Palmer Foret and Carr, Goodson & Lee, P.C., on the brief), Rockville, for appellant.
James A. Sullivan (Sullivan & Talbott on the brief), Rockville, for appellee, Ins. Co. of North America.
Paul T. Cuzmanes (Walter J. Smith, Jr. and Wilson, Elser, Moskowitz, Edelman & Dicker on the brief), Washington, D.C., for appellee, Scottish & York Intern. Ins. Group.
Argued before ALPERT, BLOOM, and KARWACKI, JJ.
ALPERT, Judge.
This is yet another appeal arising out of a struggle among three insurance companies over the question of insurance coverage. Appellant, The Travelers Indemnity Company ("Travelers") filed a declaratory judgment action against appellees, Insurance Company of North America and its parent company, CIGNA ("INA"), and Scottish & York International Insurance Group ("Scottish & York"). Mason-Dixon Recycling Corporation ("Mason-Dixon") is the named insured on an automobile insurance policy issued by Travelers. Rentals Unlimited, Inc. ("Rentals") is the named insured on policies issued by INA and Scottish & York (as excess liability insurer to the INA policy). That is, Travelers is Mason-Dixon's insurer; INA and Scottish & York are Rentals's insurers.
Travelers sought a declaration that Mason-Dixon was entitled to a defense and coverage as an insured under the INA and Scottish & York policies against a personal injury action filed by Kenneth Wayne Lee in the Circuit Court for Montgomery County. Lee filed the action against Mason-Dixon as a result of injuries he sustained on February 12, 1986. Travelers also sought an award of the costs and fees it incurred in the litigation. The declaration filed in the underlying tort action against Mason-Dixon and others alleged, in pertinent part:
that from on or about January 1, 1980 to February 12, 1980, Kenneth Wayne Lee was employed by Manpower, Inc., an agency which utilized Kenneth Wayne Lee for the purpose of picking up bound newspapers and trash on behalf of Mason-Dixon Recycling Corporation. That Mason-Dixon, by and through its agents, servants, and employees, instructed and/or permitted Kenneth Wayne Lee to ride in the rear of trucks which Mason-Dixon rented from defendant, Rentals, Unlimited, Inc., for the purpose of travelling from stop to stop and placing collected newspapers in the rear of said vehicles. No instructions were given Kenneth Wayne Lee relative to safety procedures in riding in said trailers by either defendant....
The declaratory judgment suit came on for trial before a jury presided over by Judge James J. McKenna. Evidence was presented which indicated, inter alia, that:
1. INA and Scottish and York had issued primary and excess liability policies respectively, to Rentals, Unlimited, Inc.
2. Travelers had issued a liability policy to Media General, Inc. and its subsidiaries which included Mason-Dixon Recycling Corporation.
3. Rentals Unlimited, Inc. and Mason-Dixon had been sued in the Circuit Court for Montgomery County in the underlying tort suit known as Annabelle Smith, guardian of the person and property of Kenneth Wayne Lee v. Commonwealth Recycling Corp., Law No. 62910.
4. INA from the inception declined to defend the action because, inter alia, its "liability policy excluded coverage because the plaintiff, Lee, was an employee of the appellant's insured (Mason-Dixon) who was injured during the course of his employment."
5. Mason-Dixon was in the business of collecting newspapers for recycling, rented trucks for that purpose from Rentals, Unlimited, and contracted with Manpower, Inc. to arrange for contract employees to service the pickup operation. Mason-Dixon did not have a payroll and, therefore, paid no employees.
6. Through an answer to an interrogatory, Mason-Dixon admitted that Lee was an employee of both Mason-Dixon and Manpower, Inc.
7. While picking up papers in the Silver Spring area, Lee fell from the rented truck and sustained serious personal injury.
8. The policies of Travelers and INA contained provisions excluding coverage for bodily injuries sustained by any employee of the insured arising out of the course of his employment by the insured, as well as exclusions for any obligation which the insured may be held liable for under any worker's compensation law.
Travelers' counsel conceded that Lee was on the business of both Manpower, Inc. and Mason-Dixon and did not seem to dispute that, while Lee was an employee of Manpower, he was actually under the control of Mason-Dixon's agents.
Before Travelers closed its case, the trial court ruled as a matter of law that Lee had been an employee of Mason-Dixon at the time of the accident, "thereby limiting the said Kenneth Wayne Lee to an exclusive remedy in workmen's compensation with respect to claims against ... Mason-Dixon." Further, the court ordered that "INA-CIGNA, Scottish & York ... are not required to either defend and/or indemnify ... Mason-Dixon ... for injuries and damages allegedly sustained by Kenneth Wayne Lee." From that order, this appeal was noted and the following questions were presented by the appellant:
I. Whether the court below erred in directing a verdict in this declaratory judgment action by finding that Kenneth Wayne Lee, the injured plaintiff in the underlying tort suit, was as a matter of law an employee of Mason-Dixon Recycling Corporation at the time of the accident alleged in the underlying tort suit, thereby excluding coverage for Mason-Dixon (and its successor Commonwealth Recycling Corporation) under the INA and Scottish & York policies, when the issue of Lee's employment was an issue to be decided in the underlying tort suit.
II. Whether Mason-Dixon Recycling Corporation (and its successor Commonwealth Recycling Corporation) is entitled to first and second layer liability coverage under the INA and Scottish & York policies respectively, in the underlying tort suit, by virtue of Md. Transp. Code § 18-102 (1977) and Md. Admin. Code (Transportation) 11.18.01.04.
III. Whether the Insurance Company of North America must reimburse Travelers for fees and costs incurred by Travelers in bringing this action.
IV. Whether the court below erred when it denied Travelers' motion for summary judgment.
As though the legal issues were not complicated enough, as the fates would have it, the underlying tort suit was settled while this appeal was pending. Seizing upon that fact, INA moved to dismiss the appeal on the theory that it was moot. Obviously, the question of which company must defend Mason Dixon at trial is now moot. Nevertheless, we shall decide whether the circuit court properly denied all relief to Travelers since the pre-settlement duty-to-defend and its attendant consequences survive Travelers's settlement with Lee.

QUESTIONS I, II AND IV
In our view, these three questions are so intertwined that they will be addressed collectively.

a. The Potentiality of Coverage

The circuit court's declaration that INA and Scottish & York were not responsible for Mason-Dixon's defense was based on exclusions contained in the INA policy. Those exclusions read in pertinent part:
We Will Not Cover  Exclusions:
This insurance does not apply to
.....
2. Any obligation for which the insured or his or her insurer may be held liable under any workers' compensation or disability benefits law or under any similar law.
.....
5. Bodily injury to any employee of the insured arising out of and in the course of his or her employment by the insured.
In arriving at its conclusion, the court first determined that Lee, as a matter of law, was an employee of Mason-Dixon. In the underlying tort action, Lee's status vel non as Mason-Dixon's employee would determine whether his remedy was, instead, under the Workmen's Compensation Statute.
We agree with appellant that the centrality of Lee's status as an employee in the underlying tort action made it improper for the court to decide the issue in the declaratory judgment proceedings. See St. Paul Fire & Marine Insurance Co. v. Pryseski, 292 Md. 187, 438 A.2d 282 (1981); Brohawn v. Trans-America Insurance Company, 276 Md. 396, 347 A.2d 842 (1975); Oweiss v. Erie Ins. Co., 67 Md. App. 712, 509 A.2d 711 (1986); Ohio Casualty Insurance Company v. Lee, 62 Md. App. 176, 488 A.2d 988 (1985). The theoretical basis of this rule is the desire to avoid inconsistent judgments. Id. Further, the fact that INA's policy excludes coverage for losses incurred in the course of Mason-Dixon's employment does not necessarily resolve the question of whether INA[1] was obliged to share or to carry the burden of defending Mason-Dixon. That question is resolved by the somewhat distinct standard of "potentiality" of coverage:
The obligation of an insurer to defend its insured under a contract provision such as here involved is determined by the allegations in the tort actions. If the plaintiffs in the tort suits allege a claim covered by the policy, the insurer has a duty to defend. Even if a tort plaintiff does not allege facts which clearly bring the claim within or without the policy coverage, the insurer still must defend if there is a potentiality that the claim could be covered by the policy.
Brohawn, 276 Md. at 407-408, 347 A.2d 842 (citations omitted) (emphasis in original). Because the trial court effectively usurped the function of the underlying tort action, its decision should be reversed. The allegations in the underlying tort declaration indicate that Lee's claim might be covered by the INA policy.[2] We rely upon the following parts of Lee's declaration:
Lee was employed by Manpower, Inc., an agency which utilized ... Lee for the purpose of picking up bound newspapers and trash on behalf of Mason-Dixon Recycling Corporation. That Mason-Dixon, by and through its agents, servants and employees, instructed and/or permitted Kenneth Wayne Lee to ride in the rear of the trucks which Mason-Dixon rented from defendant, Rentals Unlimited, Inc., for the purpose of travelling from stop to stop and placing collected newspapers in the rear of said vehicles. No instruction was given to Kenneth Wayne Lee relative to safety procedures in riding in said trailer by either defendant.... On or about February 12, 1980, while engaged in picking up trash, Kenneth Wayne Lee was a passenger in the trailer of Truck No. 74 ... owned by Rentals Unlimited, Inc. and rented to and operated on behalf of and by the agents, servants, and employees of Mason-Dixon, in the regular course of his employment with Manpower, Inc.... Kenneth Wayne Lee was in the rear passenger side of Truck No. 74 and as said truck was moving from one stop to another, at a speed greater than reasonable and prudent for the circumstances then existing, Kenneth Wayne Lee, through no fault of his own, was thrown from the truck striking his head and rendering him comatose with respiratory insufficiency.... Plaintiff states that the sole and proximate cause of Kenneth Wayne Lee's condition was the joint and several negligence of the defendant in that Mason-Dixon ... operated the motor vehicle involved at a speed greater than reasonable and prudent and improper and knew or should have known of the dangerous conditions to which passengers in Truck No. 74 were exposed, it caused said passengers to ride in the rear of said truck and further failed to instruct said occupants in safety or to provide safe conditions for said occupants or to train or supervise persons engaged in newspaper pickup in the safe occupation of parcel pickup.
If, on the face of the declaration, there was any doubt as to whether Lee was Mason-Dixon's employee, INA had a duty to resolve this question in Mason-Dixon's favor. See USF & G v. Nat. Pav. Co., 228 Md. 40, 55, 178 A.2d 872 (1961). See also Couch on Insurance § 51:152 (2d ed. 1982).
The language of the declaration can be interpreted to allege that Lee, an employee of Manpower, was riding in a Mason-Dixon truck when he was injured due to the negligence of Mason-Dixon. Significantly, Lee did not allege the existence of a contract between Mason-Dixon as principal contractor of the work he performed and any third party. Yet the existence of such a contract is essential to statutory employment. See Md. Ann. Code art. 101, § 58 (1985 Repl. Vol.). See also Anderson v. Bimblich, 67 Md. App. 612, 617-618, 508 A.2d 1014 (1986). Because this interpretation of Lee's pleading places his cause of action outside of the exclusions and within the coverage provided by INA's policy, INA was obligated to defend Mason-Dixon. In short, the potential for coverage existed. The fact that Mason-Dixon might later be found to be Lee's employer would not free INA from its duty to defend before such a determination was made. An interim defense should have been provided even though a declaratory judgment action was pending. See A. Windt, Insurance Claims and Disputes, § 8.10 (1982). Unfortunately, the trial judge based his determination that INA had no duty to defend on evidence tending to establish a policy exclusion rather than on the potentiality of coverage as established by Lee's declaration. Therefore, we shall vacate that determination.
We believe, however, that the evidence and admissions available to the trial judge did indeed establish that Lee was either the employee or statutory employee of Mason-Dixon. While that decision does not affect INA's duty to defend or anything we have said to this point, it does preclude indemnification. We explain.

b. Mason-Dixon as Lee's Actual Employer

In making his decision, the trial judge relied exclusively on Whitehead v. Safway Steel Products, 304 Md. 67, 497 A.2d 803 (1985).
In Whitehead, the appellant was a laborer employed by a temporary help agency, Bay Services, Inc., which was in the business of supplying unskilled labor to various industrial customers. Safway Steel Products, Inc. contacted Bay and requested two temporary help workers. Whitehead was given the task of loading steel scaffolding onto a trailer and, while he was doing so, a bundle of scaffolding fell upon him, causing serious injury. He filed for and received workmen's compensation benefits through Bay Services for his injuries, but also instituted a negligence action against Safway for the same occurrence. A jury determined that Whitehead was not an employee of Safway and that Safway was negligent in the operation of its plant. The trial judge granted a motion for judgment n.o.v. because the uncontradicted evidence demonstrated that Safway controlled Whitehead's work and, thus, Whitehead was an employee of Safway, with his only remedy for occupational injury being through the workmen's compensation laws. In affirming, the Court of Appeals restated five criteria in determining whether an employer/employee relationship exists between two parties:
(1) The power to select and hire the employee,
(2) The payment of wages,
(3) The power to discharge,
(4) The power to control the employee's conduct, and
(5) Whether the work is part of the regular business of the employer.
304 Md. at 77, 497 A.2d 803. The court went on to state that:
Of the five factors, the factor of control stands out as the most important.
304 Md. at 78, 497 A.2d 803. The court continued:
that the control exercised by Safway over Whitehead clearly establishes an employer/employee relationship. Safway instructed Whitehead on the tasks to be performed, supervised his work, and was free to reassign him to any other duties that warranted attention. If Whitehead's work was unsatisfactory, Safway was free to dismiss him and request an additional worker.
304 Md. at 79, 497 A.2d 803. In the case sub judice, the uncontradicted evidence indicated that Mason-Dixon directed the newspaper pickup routes through one Fowler, an employee of a parent corporation. If Fowler did not like the performance of a Manpower employee, he could call Manpower and Manpower would replace that employee. As to the actual moment-to-moment supervision of Lee, it appears inferentially that other Manpower employees in a supervisory capacity were in charge of Lee's daily activities. Yet, it is uncontradicted that, in performing their duties, Manpower's workers were the agents, servants, and employees of Mason-Dixon. The only distinction between the facts of this case and the facts in Safway lies in the fact that Safway's employees instructed Whitehead on "the tasks to be performed, supervised his work, and [were] free to reassign him to any other duties that warranted attention." The evidence developed in the instant case tends to indicate that while Mason-Dixon established the route, a co-employee of Manpower, under Mason-Dixon's direction, was Lee's immediate supervisor. Viewing the evidence in a light most favorable to Lee, there is no evidence which would authorize reassignment, other than the picking up of newspapers or trash. Under Safway, Lee may well be Mason-Dixon's (actual) employee.

c. Mason-Dixon as a Statutory Employer

If Lee was not the (actual) employee of Mason-Dixon, then he certainly must have been its "statutory" employee. See Anderson v. Bimblich, supra. See also Pressman, Workmen's Compensation in Maryland § 2-4(3) (2d ed. 1977). In Anderson v. Bimblich, the appellant, Anderson, was a maintenance man employed by a company which managed an apartment building owned by Bimblich and others. There, we were called upon to decide whether Bimblich, as owner of the apartment building, was a principal contractor within the meaning of the workmen's compensation laws, and thus the statutory employer of Anderson. There, as here, an employee was injured in the course of his employment for a company supplying the manpower in order to do another's work. That company paid his wages. Similarly, Manpower, Inc. paid Lee's wages. Anderson's daily activities were controlled by the management company, just as Lee's daily activities were apparently controlled by other Manpower employees under the direction of Mason-Dixon. We observed in Anderson that "even if an insured worker has recovered under the Act, he may still sue a person other than his employer in a third-party tort action, but that in order to succeed in the third-party action, Anderson was required to show that the apartment building owners were not his employer. Affirming the trial court's decision that the owners were, indeed, the statutory employer of Anderson, we repeated the elements necessary to establish statutory employment as explicated by Judge Orth in Honaker v. W.C. & A.N. Miller Development Company, 278 Md. 453, 459-60, 365 A.2d 287 (1976):
There must be:
1. A principal contractor
2. who has contracted to perform work
3. which is a part of his trade, business, or occupation; and
4. who has contracted with any other party as a subcontractor for the execution by or under the subcontractor of the whole or any part of such work.
Under this analysis, we liken Mason-Dixon to the principal contractor who has contracted to perform work for Montgomery County. Mason-Dixon, in turn, subcontracted with another party, Manpower, Inc., to execute part of the overall job, i.e., the picking up of the newspapers and trash.

d. Dual Employment

Even if Lee was simultaneously the employee of Manpower and Mason-Dixon, as admitted by Mason-Dixon at one point below, his exclusive remedy for compensation remains under the Worker's Compensation Act. Mackall v. Zayre Corp., 293 Md. 221, 229-31, 443 A.2d 98 (1982).
However we examine Lee's employment status, his exclusive remedy is under the workmen's compensation statute. Thus, we conclude that while there may have been the potential need to defend, the exclusion under each policy precludes any duty by INA to indemnify Mason-Dixon. We can conceive of no scenario whereby Mason-Dixon could be considered "some person other than the employer" under Art. 101, § 58. Thus, although the trial judge should never have reached the issue of Lee's employment, the subsequent settlement allows us to rely upon the court's decision to resolve the issue of indemnity. It would serve no useful purpose, and even defies common sense, to remand the case with instructions to the trial judge to review the evidence in order to determine indemnification when he has, albeit prematurely, decided the employment issue. Nor do we see any value in remanding this case on the issue of INA's duty to defend. We resolved that issue hereinabove merely by assessing the potentiality of coverage as found in the pleadings.
Having determined that INA had a duty to defend but not to indemnify Mason-Dixon, we move now to the issue of attorney's fees and expenses incurred in defending the underlying tort suit and prosecuting the declaratory judgment.

QUESTION III
Travelers argues that it is entitled to expenses and fees incurred in defending (to the date of settlement) the underlying tort action by Lee and in prosecuting the declaratory judgment action against INA.
Because the costs incurred arise out of two different kinds of actions and their respective recoveries are based on diverse legal theories, we shall address them separately.

a. Costs of Defending the Underlying Tort Action

The right of one insurer to recover from another insurer costs incurred in defending an action that the other insurer was obligated to defend was recognized in the case of Ryder & Whitehouse, 259 Md. 354, 269 A.2d 826 (1970). In that case, there was a conflict over the "virtually identical `other insurance' clauses of two automobile liability insurance policies." Schapiro rented a tractor from Ryder, which tractor was insured by Liberty Mutual Insurance Company. Schapiro also owned trailers that were insured by Aetna Casualty & Surety Company. A Schapiro trailer was hitched to the Ryder tractor when the tractor-trailer, driven by Schapiro's employee, collided with a Baltimore Transit Company bus. Ryder and Liberty Mutual refused to defend Schapiro and its employee against claims filed by passengers on the bus. Aetna settled all claims except one that went to trial, resulting in a judgment against Schapiro alone and a judgment in favor of Ryder and the employee. It was conceded that the proximate cause of the accident was Schapiro's negligence in the maintenance of brakes on its trailer and that Ryder was free of negligence. Aetna expended $27,576.13, including payment of the judgment, in settling all claims. Significantly, that amount also included counsel fees. Thereafter, Aetna sued Liberty Mutual to recover the $27,576.13. The trial court held that Liberty must pay Aetna the entire $27,576.13. The Court of Appeals, in reversing that judgment, concluded that the two insurance companies should share equally in the amount of settlements and expenses. Pursuant to Rule 875a, the court entered judgment in favor of Aetna for one-half the sum expended in settling the claims against Schapiro. Thus, the court recognized that one insurance carrier having a duty to defend which denies that duty must reimburse costs and attorney's fees to another carrier that steps in to provide the defense.

b. Costs of Prosecuting the Declaratory Judgment Action

In Bankers and Shippers Ins. Co. v. Electro Enter., 287 Md. 641, 415 A.2d 278 (1980), the Court of Appeals held that a person who is within a policy definition of "insured" and against whom a claim alleging a loss within policy coverage has been filed may recover the cost of prosecuting a declaratory judgment against an insurer that unjustifiably refused to provide a defense. In Western World Ins. Co., Inc. v. Harford Mutual Ins. Co., 602 F. Supp. 36 (D.Md. 1985), an assignee, standing in the shoes of an insured who had been denied a defense, recovered fees and costs incurred in prosecuting a declaratory judgment against the insurer, by which it was determined that the insurer had unjustifiably refused to defend. Both Bankers and Western World stand on the authority of an early case, Cohen v. American Home Assurance Co., 255 Md. 334, 258 A.2d 225 (1969). In Cohen, the Court of Appeals held that an insured could recover attorney's fees and costs incurred in prosecuting a declaratory judgment from an insurer who unjustifiably has refused to defend:
[W]hether one speaks in terms of its having authorized the expenditure by its failure to defend or whether one speaks in terms of the attorney's fees for the declaratory judgment action being a part of the damages sustained by the insured by [insurer's] wrongful breach of the contract, we hold [insurer] bound to pay the fees incurred by [insured] in bringing the declaratory judgment action to establish that [insurer] had not done that which it had agreed with her to do.
255 Md. at 363, 258 A.2d 225. The first of the two principles on which the court in Cohen based this award would appear to justify a defending insurer's claim for the same recovery. That is, the cost of prosecuting a declaratory action against a recalcitrant insurer has been "authorized" by its refusal to defend whether the declaratory action is brought by the insured or the defending insurer.
Further, it is generally recognized that an insurer is subrogated to claims of its insured against others, whether ex contractu or ex delicto, once the insurer has indemnified the insured for his loss. Svea Assurance Co. v. Packham, 92 Md. 464, 465-66, 48 A. 359 (1901); Couch, supra, § 61:4, Keaton, Insurance Law, § 3.10(a) (1971). The rights to which the insurer is subrogated have been broadly described as, "all the rights of recovery of the insured of every nature, whatsoever." Svea, 92 Md. at 465, 48 A. 359.
In Gov't Employees Ins. Co. v. Taylor, 270 Md. 11, 310 A.2d 49 (1973), the Court of Appeals directed a trial court to enter a declaration that a non-defending insurer, GEICO, was responsible for fees incurred by the Unsatisfied Claim and Judgment Fund in obtaining a declaration that GEICO was obligated to defend GEICO's erstwhile insureds, the Taylors. Claims against the Taylors arising out of an automobile accident were referred to the Fund when GEICO denied coverage. In directing the award of "the reasonable cost incurred [by the Fund] incident to [the] declaratory judgment action," the court relied on the equitable principle of subrogation. 270 Md. at 22, 310 A.2d 49.
In light of the GEICO decision, we believe the package of rights to which a defending insurer is subrogated includes the insured's right to recover the cost of prosecuting a declaratory action against an insurer declared to have wrongfully refused to provide a defense.

CONCLUSION
In view of our holding, Travelers is entitled to no contribution toward its settlement with Lee, but INA must reimburse Travelers for reasonable expenses, including costs and attorney's fees, incurred in defending Mason-Dixon and in prosecuting the declaratory action. The amount of fees and expenses, however, must be established "with the certainty and under the standards ordinarily applicable for proof of contractual damages." See Bankers & Ship. Ins., supra [287 Md.] at 661, 415 A.2d 278. The extent to which Travelers brought upon itself unnecessary expenses is a matter that can be addressed on remand.
JUDGMENT VACATED; CASE REMANDED FOR FURTHER PROCEEDINGS NOT INCONSISTENT WITH THIS OPINION; COSTS TO BE PAID BY THE APPELLEES.
NOTES
[1]  We note here that the Scottish & York policy follows the INA policy as the excess-coverage to the INA contract. Consequently, Scottish & York's obligations follow those of INA.
[2]  Travelers contends that pursuant to Md.Transp.Code Ann. § 18-102 (1977) and Md.Admin.Code (COMAR, Trans. Title) 11.18.01.04, INA was obligated to defend Mason-Dixon, Travelers' insured, against Lee's suit. Those provisions generally require that the insurer of an owner/lessor of a vehicle must provide coverage for anyone using the vehicle with the lessee's permission. Additionally, the INA policy specifically follows the vehicle in question whereas the truck is not a covered auto under the Travelers policy. These facts further support Travelers' assertion that there was a potential that the INA policy covered this loss.
