
302 Md. 825 (1985)
490 A.2d 1296
RAMSAY, SCARLETT & CO., INC.
v.
COMPTROLLER OF THE TREASURY.
No. 102, September Term, 1984.
Court of Appeals of Maryland.
April 25, 1985.
Paul Grimm, Baltimore (argued) (Neil S. Kurlander, William C. Stifler III and Niles, Barton & Wilmer, Baltimore, on brief), for appellant.
Gerald Langbaum, Asst. Atty. Gen., Baltimore (Stephen H. Sachs, Atty. Gen. and John K. Barry, Asst. Atty. Gen., Baltimore, on brief), for appellee.
Argued before MURPHY, C.J., SMITH, ELDRIDGE, COLE, RODOWSKY, and COUCH, JJ., and CHARLES E. ORTH, Jr., Associate Judge of the Court of Appeals of Maryland (retired), Specially Assigned.
MURPHY, Chief Judge.
This case involves an assessment of additional corporate income tax by the Maryland Comptroller of the Treasury upon Ramsay, Scarlett & Company, Inc. (Ramsay Scarlett), pursuant to the provisions of Maryland Code (1957, 1980 Repl.Vol.), Article 81, § 316(c), which insofar as pertinent reads as follows:
"(c) [Business income] shall be allocated to this State if the trade or business of the corporation is carried on wholly within this State, but if the trade or business of the corporation is carried on partly within and partly without this State so much of the business income of the corporation as is derived from or reasonably attributable to the trade or business of the corporation carried on within this State, shall be allocated to this State and any balance of the business income shall be allocated outside this State. The portion of the business income derived from or reasonably attributable to the trade or business carried on within this State may be determined by a separate accounting where practicable, but never in the case of a unitary business; however, where separate accounting is neither allowable nor practicable the portion of the business income of the corporation allowable to this State shall be determined in accordance with a three-factor formula of property, payroll and sales, in which each factor shall be given equal weight...." (Emphasis added.)
Section 316(c) thus makes provision for allocating the net business income of a Maryland corporation with interstate activities; in effect, it requires that such taxable income be determined and allocated according to (1) whether the business enterprise is comprised of separate entities, in which event the "separate accounting" method may be utilized to segregate locally taxable business income on the basis of formal geographical or transactional accounting, or (2) whether the enterprise is a unitary business, in which case the apportionment formula method must be utilized to subject the entire business income to tax while apportioning a part thereof between Maryland and other taxing jurisdictions on the basis of objective measures indicative of a corporation's Maryland and out-of-state activities, i.e., property, payroll and sales factors.[1]

I
Ramsay Scarlett, a Maryland corporation, was established in 1926. The corporation's principal place of business is in Baltimore (the Maryland operation). It also maintains several out-of-state divisions, including an unincorporated bulk terminal operation in Louisiana (the Louisiana division). During the four-year tax period in question (1974-1977, inclusive), the Maryland operation engaged principally in steamship agency and stevedoring operations. The Louisiana division was engaged primarily in warehousing (or export bagging) and operated a barge facility  activities not common to Ramsay Scarlett's Maryland operation. The Louisiana division was also minimally involved in stevedoring and steamship agency work.
In filing its 1974-1977 Maryland income tax returns, Ramsay Scarlett used "separate accounting" for its Louisiana division, thus excluding income realized from its operations in Louisiana from Maryland taxation. The Comptroller was of the view that Ramsay Scarlett operated a unitary business and could not, in view of § 316(c), separately account for its Louisiana division. He, therefore, levied additional tax upon Ramsay Scarlett, amounting to $31,840 for the four-year period.
On appeal to the Tax Court, that agency held that whether a business is unitary involves a factual analysis applied in light of either one of two established legal tests, the first of which  the three unities test  focuses upon the presence of three factors, i.e., (1) unity of ownership, (2) unity of operation as evidenced by central purchasing, advertising, accounting and management divisions, and (3) unity of use in its centralized executive force and general system of operation. The other test for determining unitariness which the Tax Court recognized was whether one business enterprise was dependent upon or contributory to the other, i.e., that whether a number of business operations having a common ownership constitute a single or unitary business or several separate businesses for tax purposes turns on whether they are of mutual benefit to one another or whether each operation is independent of or contributory to others. After noting that these tests for determining unitariness were approved by us in Xerox Corp. v. Comptroller, 290 Md. 126, 428 A.2d 1208 (1981), the Tax Court considered the evidence before it. It said:
"Ramsay Scarlett has introduced a long list of functions that are performed independently by the Louisiana branch. Some of the more substantial functions are as follows: maintaining banking sources and checking accounts; borrowing independently; using local labor union workers; paying local wages; paying expenses; soliciting customers; collecting bills; determining rates to be charged and independent hiring and firing of employees. The Louisiana branch had its own head of operations and retained Louisiana legal and accounting services, wholly unconnected with the Baltimore operation.
"The Comptroller does not refute these contentions but rather introduces other factors which tend to indicate an interdependency between the two operations: Louisiana and Maryland employees were on a common profit sharing plan; there was some company-wide insurance; the Baltimore management did a periodic but limited review of the Louisiana operation; the payroll of office personnel was handled in Baltimore and profits from the Louisiana operation were sometimes transferred to the Baltimore operation.
"The Comptroller has identified some tangible connections between Ramsay Scarlett's Baltimore and Louisiana operations. However, the connections are incidental and most probably arise as matters of convenience. There is no indication that either the Baltimore or the Louisiana branch depends on these connections; nor do they establish central management or control. On the contrary, the evidence tends to indicate that through separate day to day management, purchasing, sales, accounting, advertising and financing, each of these branches operates independently."
The Tax Court also found from the evidence that even though Ramsay Scarlett's Board of Directors in Baltimore retained normal corporate management powers over its Louisiana division, the "actual management functions" of the division were exercised by personnel in Louisiana, as the Board "allowed the Louisiana branch to operate of its own force." While the Tax Court recognized that it was from Ramsay Scarlett's capital produced in Baltimore that the Louisiana division originated, it said that the appropriate focus under our cases was "on the ongoing business structure rather than past investment"; that the original investment in the Louisiana branch sixteen years earlier had long since been expended; and that the Louisiana division "now finances its own purchases." Finally, the Tax Court held that Ramsay Scarlett established "that its Louisiana operation branch operates independently from its Maryland operation, and the Comptroller has failed to establish that activities in Maryland have any substantial bearing on the Louisiana operation."
Upon the Comptroller's appeal to the Circuit Court for Baltimore City, that court (Bell, J.) noted that its on-the-record review of the Tax Court's order was a narrow one under Code, Art. 81, § 229(o), as that section provided that the circuit court
"affirm the Tax Court order if it is not erroneous as a matter of law and if it is supported by substantial evidence appearing in the record."
The court, after considering the evidence produced before the Tax Court, concluded that the record contained substantial evidence to support the agency's factual finding that the Louisiana division operated independently of the Maryland operation and that Ramsay Scarlett's operations did not constitute a unitary business. It said:
"Reasoning minds reasonably could have reached that factual conclusion. In addition, this Court perceives no error of law."
The Court of Special Appeals vacated the circuit court's judgment and directed that the Tax Court order be reversed. Comptroller v. Ramsay, Scarlett & Co., 58 Md. App. 327, 473 A.2d 469 (1984). Citing Comptroller v. Diebold, Inc., 279 Md. 401, 369 A.2d 77 (1977), the intermediate appellate court noted that judicial review of Tax Court decisions under § 229(o) is severely limited; that the standard by which a result reached by the Tax Court is reviewed is whether a reasoning mind reasonably could have reached the factual conclusion which the agency reached; and that the application of this test must not be either judicial fact-finding or a substitution of judicial judgment for agency judgment. 58 Md. App. at 337. This limitation upon judicial review, the court said, is addressed only to agency fact-finding and that, as to matters of law, the reviewing court may substitute its judgment for that of the agency. Id., 58 Md. App. at 338, 473 A.2d 469. It said that when agency conclusions are based on facts supported by substantial evidence, and when the conclusions are not contrary to law, a court ordinarily will not substitute its judgment for that of the agency; but where the factual context of a particular controversy is undisputed, the reviewing court may substitute its own judgment on questions of law. Id. Relying on principles articulated in Earth Resources Co. v. St. Dept. of Rev., 665 P.2d 960 (Alaska 1983)  a similar case involving unitariness of a business  the Court of Special Appeals said that the issue of whether Ramsay Scarlett was conducting a unitary business was a question of law, and not of fact. It indicated concurrence with the view expressed in Earth Resources (1) that whether the appropriate rule of law has been applied to a given set of facts is a question requiring a standard of review different than the substantial evidence test used in reviewing questions of fact, and (2) that a substitution of judgment standard is properly applied for questions of law involving no agency expertise, i.e., where the knowledge and experience of the agency is of little guidance to the court or where the case concerns statutory interpretation or other analysis of legal relationships about which courts have specialized knowledge and experience, and (3) that application of the substitution of judgment standard permits a reviewing court to substitute its own judgment for that of the agency, even if the agency's decision had a reasonable basis in law. Id. 58 Md. App. at 340, 473 A.2d 469.
In utilizing the "substitution of judgment" standard of review, the Court of Special Appeals first noted that the Tax Court's decision did not resolve any policy or legal questions within that agency's area of expertise, but rather applied "judicially-developed standards to facts that involved common business operations and practices in order to reach a legal conclusion." Id. at 340, 473 A.2d 469. The court thereafter engaged in an extensive analysis of federal and state case holdings dealing with the unities and dependency tests for determining whether a business was unitary in nature. It concluded in effect that the Tax Court did not properly apply the substance of these legal tests to the evidence appearing in the record and that as a matter of law the Tax Court erred in holding that Ramsay Scarlett had sustained its burden of proving the distinct and separate nature of its Louisiana division.
Ramsay Scarlett petitioned for certiorari questioning (1) whether the Court of Special Appeals applied the appropriate standard in its review of the Tax Court's order and (2) whether the intermediate appellate court was wrong in concluding as a matter of law that the Louisiana division was part of Ramsay Scarlett's unitary business. We granted certiorari to consider these issues of public importance.

II
As already indicated, § 229(o) requires that a reviewing court affirm a Tax Court order (1) if it is not erroneous as a matter of law and (2) if it is supported by substantial evidence appearing in the record. Under this standard, a reviewing court is under no statutory constraints in reversing a Tax Court order which is premised solely upon an erroneous conclusion of law. See, e.g., Supervisor of Assess. v. Carroll, 298 Md. 311, 469 A.2d 858 (1984); Comptroller v. Mandel Re-Election Com., 280 Md. 575, 374 A.2d 1130 (1977). On the other hand, where the Tax Court's decision is based on a factual determination, and there is no error of law, the reviewing court may not reverse the Tax Court's order if substantial evidence of record supports the agency's decision. See, e.g., Comptroller v. Haskin, 298 Md. 681, 472 A.2d 70 (1984), which involved the question whether a Maryland domiciliary who accepts employment in a foreign country and moves there for an indefinite time, but later returns to Maryland, has continuously maintained Maryland domicile for state income tax purposes. While the issue of law in that case focused upon the requisite legal test for determining a person's domicile, the controlling factor in the test's application was a question of fact, i.e., the intent of the individual as objectively shown by a multitude of factors associated with the particular person. After determining that the Tax Court did not err as a matter of law in holding that the taxpayers were not Maryland domiciliaries during the tax period in question, we said that the only remaining issue was whether the Tax Court's orders were supported by substantial evidence, i.e., by such relevant evidence as a reasonable mind might accept as adequate to support a conclusion. 298 Md. at 693, 472 A.2d 70. With the case in this posture, we cautioned that a reviewing court may not substitute its judgment for the expertise of the agency; that we must review the agency's decision in the light most favorable to it; that the agency's decision is prima facie correct and presumed valid; and that it is the agency's province to resolve conflicting evidence and where inconsistent inferences can be drawn from the same evidence it is for the agency to draw the inferences. Id. at 693-94, 472 A.2d 70. See also Baltimore Lutheran High School Assoc., Inc. v. Employment Security Adm., 302 Md. 649, 490 A.2d 701 (1985).
The question involved in Comptroller v. Diebold, Inc., 279 Md. 401, 369 A.2d 77 (1977), as here, was whether the Tax Court erred in holding that an unincorporated division of a Maryland corporate taxpayer was entitled to separate accounting under § 316(c). The corporation, Diebold, Inc., was engaged in the manufacture and sale of bank and office equipment. It owned and operated Young & Selden, an unincorporated division whose principal business activity was the printing of checks and other business forms in Maryland. The Comptroller maintained that Diebold conducted a unitary business and that its Maryland income tax had to be computed under § 316(c) by the application of the three-factor formula to its aggregate property, payroll and sales. Diebold pointed out that Young & Selden was engaged in a different business, had its own officers and sales force, and maintained its own payroll and accounting system. After noting the applicability of the unities test, we said that whether a business can be regarded as unitary may hinge on unity of ownership and management; on whether the business operated within a state is dependent upon or contributes to the business operated without the state; on whether major policy decisions are made within or without the state; or on whether income is commingled and used for purposes of the business. 279 Md. at 406, 369 A.2d 77. We observed that the Tax Court, after reviewing the cases on both sides, concluded "that Diebold and Young & Selden did not comprise a unitary business, because unity of use, management, ownership and purchasing was lacking, but rather that there were two separate businesses...." 279 Md. at 408, 369 A.2d 77. Perceiving no error of law in the Tax Court's holding, id. at 408, 369 A.2d 77, and noting the narrow statutory limits imposed upon our judicial review under what is now § 229(o), we affirmed the Tax Court's order. Citing Fairchild Hiller v. Supervisor, 267 Md. 519, 521, 298 A.2d 148 (1973), we said that the proper standard of review was whether a reasoning mind reasonably could have reached the factual conclusion which the Tax Court reached; and that the application of this test "must not be either judicial fact finding or a substitution of judicial judgment for agency judgment." Id., 279 Md. at 407, 369 A.2d 77.
It is thus clear that in Diebold we found that the Tax Court committed no error of law and that its order was supported by substantial evidence when it held, after its factual analysis of the evidence of record, that the business there involved was not a unitary one but rather was entitled to separate accounting under § 316(c). In the present case, the Court of Special Appeals paid scant attention to Diebold; instead, it placed reliance upon cases, in addition to Earth Resources Co. v. St. Dept. of Rev., supra, where courts, in reviewing administrative agency decisions, held that whether a business is unitary for tax purposes is a question of law upon which a reviewing court is free to substitute its judgment for that reached by the agency. See, e.g., Becton, Dickinson & Co. v. Department of Rev., 383 Mass. 786, 422 N.E.2d 1350 (1981); Wisconsin Dept. of Revenue v. Exxon Corp., 90 Wis.2d 700, 281 N.W.2d 94 (1979), aff'd, 447 U.S. 207, 100 S.Ct. 2109, 65 L.Ed.2d 66 (1980). The Court of Special Appeals thereafter made an independent evaluation of the evidence appearing in the record. In considering the various components of the unities test, it first expressed the view that the Tax Court did not give requisite consideration or weight to the fact that there was full unity of ownership between Ramsay Scarlett and its unincorporated Louisiana division. As to the unity of operation, it said that the Tax Court had "misapplied" that concept; that there was a high degree of operational unity between Ramsay Scarlett and its Louisiana division in that certain functions, such as payroll processing and administration of the corporation's profit sharing and health insurance plans, and maintenance of general liability and workmen's compensation insurance coverage, were performed centrally in Baltimore. Similarly, the intermediate appellate court was of the view that the Tax Court did not properly consider that there was unity of use, i.e., the corporate control exercised by Ramsay Scarlett over the operations of the Louisiana division in that, for example, the record showed that Ramsay Scarlett's Board of Directors in Baltimore approved the acquisition of a warehouse site in Louisiana and directed the remission of excess profits derived from its Louisiana operations to Baltimore; and also that the stationery used by the Louisiana division acknowledged its affiliation with Ramsay Scarlett. Applying the more general dependency test to the evidence in the record, the Court of Special Appeals reached the same result, i.e., that it was not within the realm of permissible judgment for the Tax Court to find that Ramsay Scarlett's Louisiana division was not dependent upon its Maryland operation.

III
We think the Court of Special Appeals was wrong in holding that the determination of whether Ramsay Scarlett's Louisiana division was entitled to separate accounting under § 316(c) was solely a question of law, involving no agency expertise and hence justifying a substitution of judgment standard of appellate review under the provisions of § 229(o). The difference between the Comptroller's position, which the Court of Special Appeals adopted, and Ramsay Scarlett's position, which the tax and circuit courts adopted, is based essentially on differing views  not as to the law governing the case  but rather as to its proper application to the established evidence of record before the Tax Court. There was, of course, no error of law in the Tax Court's utilization of the unities and dependency tests which we approved in Xerox Corp. v. Comptroller, supra. Nor do we find a failure on the part of the Tax Court to comprehend the legal substance of those tests, or an agency misapplication of their precepts to the evidence before it. And contrary to the view taken by the intermediate appellate court, we think agency expertise was involved in the determination whether, in view of the controlling legal tests, the evidence reflected such a degree of operational interdependency and of the unities of ownership, operation and use as would preclude separate accounting under § 316(c).[2] As we see it, whether a business is unitary or separate and distinct for tax purposes under § 316(c) is not solely a question of law; rather, the issue for purposes of appellate review under § 229(o) is governed by whether, in light of substantial evidence appearing in the record, a reasoning mind could reasonably have reached the conclusion reached by the Tax Court, consistent with a proper application of the unities and dependency tests. Diebold, supra.
Of course, in reviewing the order of an administrative agency like the Tax Court, the appellate court must not make an independent original estimate of or decision on the evidence. Baltimore Lutheran, supra; Ins. Comm'r v. Nat'l Bureau, 248 Md. 292, 236 A.2d 282 (1967). Nor may it determine for itself, as a matter of first instance, the weight to be accorded to the evidence before the agency. Thus, in this case, the various factual determinations underlying the application of the unities and dependency tests to the business relationships between Ramsay Scarlett and its Louisiana division were solely for agency determination. The Tax Court's factual findings that day-to-day management of the Louisiana division was actually vested in the division's personnel, including the functions of purchasing, sales, accounting, advertising and finance, as well as other factors indicative of a discrete business enterprise separate and distinct from Ramsay Scarlett's Maryland operation, were clearly supported by substantial evidence of record. Diebold, not Earth Resources, controls the disposition of this case. As in Diebold, we conclude that the Tax Court committed no error of law and that its order was supported by substantial evidence. Quite simply, this is not a case, as found by the Court of Special Appeals in substituting its judgment on the law for that of the agency, where the Tax Court's factual findings supported by substantial evidence were susceptible of only one legal conclusion, i.e., that the Louisiana division was part of Ramsay Scarlett's unitary business. Since on the facts of this case a reasoning mind could reasonably arrive at the conclusion that separate accounting was authorized under § 316(c), we must abide by the Tax Court's ruling, yielding to its expertise and to the presumption that its decision is correct.[3]
JUDGMENT REVERSED; CASE REMANDED TO THE COURT OF SPECIAL APPEALS WITH INSTRUCTIONS TO REMAND THE CASE TO THE CIRCUIT COURT FOR BALTIMORE CITY FOR ENTRY OF JUDGMENT AFFIRMING THE ORDER OF THE MARYLAND TAX COURT; COSTS TO BE PAID BY THE COMPTROLLER OF THE TREASURY.
NOTES
[1]  For more extensive discussion of the unitary business tax, see Container Corp. of America v. Franchise Tax Bd., 463 U.S. 159, 103 S.Ct. 2933, 2939-2941, 77 L.Ed.2d 545, reh. denied, ___ U.S. ___, 104 S.Ct. 265, 78 L.Ed.2d 248 (1983); G. Weissman, Unitary Taxation: "Its History and Recent Supreme Court Treatment," 48 Albany Law Review 48 (1983).
[2]  That the Louisiana division was an unincorporated part of Ramsay Scarlett's corporate enterprise does not itself mandate a finding that the former was part of the latter's unitary business. Diebold, supra.
[3]  In so holding, we have reviewed Container Corp. of America v. Franchise Tax Bd., 463 U.S. 159, 103 S.Ct. 2933, 77 L.Ed.2d 545, reh. denied, ___ U.S. ___, 104 S.Ct. 265, 78 L.Ed.2d 248 (1983); F.W. Woolworth Co. v. Taxation and Revenue Dept., 458 U.S. 354, 102 S.Ct. 3128, 73 L.Ed.2d 819 (1982); Asarco, Inc. v. Idaho State Tax Com'n, 458 U.S. 307, 102 S.Ct. 3103, 73 L.Ed.2d 787 (1982). These cases, upon which both parties place some reliance, address constitutional issues related to state income taxation of corporations arising out of interstate activities. Nothing in these constitutionally oriented decisions bears authoratively on the standard of review issues raised in the present case.
