
456 B.R. 361 (2011)
In re Juvenal GARCIA, Debtor.
Juvenal Garcia, Movant/Appellant,
v.
Cynthia A. Miller, Defendant.
Bankruptcy No. 09 BK 34462. No. 10 C 3101.
United States District Court, N.D. Illinois, Eastern Division.
May 10, 2011.
*362 Steven Shaw Potts, Steven S. Potts, Attorney at Law, Northbrook, IL, for Movant/Appellant.
Cynthia Ann Miller, Law Office of Cynthia Miller & Assoc. P.C., Downers Grove, IL, U.S. Bankruptcy Court, Clerk, United States Trustee, Office of the United States Trustee, Judge Cox, United States Bankruptcy Court, Chicago, IL, for Defendant.

MEMORANDUM OPINION AND ORDER
JAMES B. ZAGEL, District Judge.
Juvenal Garcia, Debtor and Appellant, seeks a review of the bankruptcy court's *363 determination that Cynthia Miller is not subject to Section 329 of the Bankruptcy Code. Garcia alleges that Miller, an attorney who represented him prior to filing bankruptcy, overcharged him for services rendered in contemplation of bankruptcy and should be ordered to disgorge those fees paid in excess of their reasonable value. The bankruptcy court's order is vacated and the case is remanded for a determination in accordance with the proper legal standard for whether the services were rendered "in contemplation" of bankruptcy under Section 329.

I. STANDARD OF REVIEW
This court is authorized to hear an appeal from a bankruptcy court under 28 U.S.C. § 158(a). While the factual findings of a bankruptcy court will be reviewed for clear error, questions of law are reviewed de novo. In re Berman, 629 F.3d 761, 766 (7th Cir.2011). Interpretation of the bankruptcy code presents a question of law. In re Willett, 544 F.3d 787, 790 (7th Cir.2008).

II. STATEMENT OF FACTS
In May or June of 2009, Juvenal Garcia contacted Cynthia Miller, an attorney, for legal assistance. Garcia contends that he employed Miller for the purpose of defending him in a number of foreclosure suits and to restructure his debts. Miller asserts, however, that she was initially hired to assist with the short sale of one of Garcia's properties and that only after a number of meetings with him did she learn that his lenders had commenced foreclosure proceedings. Miller further contends that she prepared documents to defend Garcia in these proceedings, but that Garcia refused to file them for fear of angering his lenders. Thus, Miller asserts that because of the work done on behalf of Garcia, though she did not appear in court, the value of her services were commensurate with the fees charged. Lastly, Miller asserts that she arranged meetings with real estate brokers and investors, but that Garcia would cancel the listings before the properties could be sold.
On June 29, 2009, Garcia signed an "Attorney Retainer Agreement" with Miller. Under this agreement Garcia agreed to pay $24,000 for legal services already performed as well as those that had yet to be undertaken. Garcia alleges that he paid Miller the entire $24,000. Miller asserts, however, that Garcia only paid $7,000 in installments of $2,000 and $5,000.
Miller testified that after representing Garcia for a number of months she finally learned of his financial condition and advised him to seek bankruptcy protection. Miller made a number of calls on behalf of Garcia, and Steven Potts agreed to represent him in his bankruptcy filing. Garcia filed for Chapter 11 on September 17, 2009. In addition, one of Miller's assistants provided Potts with a list of the foreclosure suits filed against Garcia for inclusion in the "Debtor's Statement of Financial Affairs" filed on October 4, 2009.
After obtaining from Miller an itemized list of her charges on January 15, 2010, Garcia filed a motion in bankruptcy court seeking a hearing pursuant to 11 U.S.C. § 329 for the disgorgement of fees paid, asserting that he had paid Miller fees in excess of the reasonable value of the services, which were provided in contemplation of bankruptcy. Following a hearing on March 10 and March 16, 2010, the bankruptcy court determined that the debtor should prevail but postponed a determination of the amount that Miller must disgorge. However, in a written order issued on April 22, 2010, the court reversed its oral ruling and found that Miller was not subject to Section 329.


*364 III. DISCUSSION
Section 329(a) requires "Any attorney representing a debtor in a case under this title, or in connection with such a case" to "file with the court a statement of the compensation paid or agreed to be paid, if such payment or agreement was made after one year before the date of the filing of the petition, for services rendered or to be rendered in contemplation of or in connection with the case by such attorney. . ."[1] Section 329(b) allows the court to order the disgorgement of such fees "[i]f such compensation exceeds the reasonable value of any such services . . ." Thus, to be subject to 329 the attorney's services must be "in contemplation of or in connection with" the debtor's bankruptcy. In re Zepecki, 277 F.3d 1041, 1045 (8th Cir.2002).
To determine if payments were made "in contemplation" of bankruptcy, courts must consider whether "the underlying professional services were rendered at a time when the debtor was contemplating bankruptcy." In re Gage, 394 B.R. 184, 194 (Bankr.N.D.Ill.2008). Thus, a subjective test of the debtor's state of mind is used in determining if a transaction is subject to Section 329. See Zepecki, 277 F.3d at 1045; In re Dixon, 143 B.R. 671, 675 n3 (Bankr.N.D.Tex.1992) (articulating the test as "whether, in making the transfer, the debtor is influenced by the possibility or imminence of a bankruptcy proceeding"); In re GIC Gov't Securities, Inc., 92 B.R. 525, 531 (Bankr.M.D.Fla. 1988) (asserting that fees paid for the purpose of avoiding bankruptcy are "clearly `in contemplation of bankruptcy'").
Services rendered for the prevention of bankruptcy are within the ambit of Section 329. See In re Prudhomme, 43 F.3d 1000, 1004 (5th Cir.1995) (finding that representation for the purpose of resolving a dispute with the debtor's largest creditor was in contemplation of bankruptcy); In re Perrine, 369 B.R. 571, 581-82 (Bankr. C.D.Cal.2007). Yet, non-bankruptcy services must bear "more than a casual relationship to the bankruptcy proceeding." In re Swartout, 20 B.R. 102, 106 (Bankr. S.D.Ohio 1982) (holding that services related to the debtor's divorce, although intertwined with his bankruptcy, were not in connection with the bankruptcy); see In re Bressman, 327 F.3d 229, 240 (3rd Cir.2003) (finding that fees paid to defend the debtor against criminal charges arising from the collapse of the debtor's business were not in connection with the bankruptcy).
The bankruptcy court's order emphasizes the fact that Miller did not serve as Garcia's bankruptcy counsel, and that documents provided by Miller's assistant to Potts were not given with her knowledge and consent. The bankruptcy court reasons that Miller is therefore beyond the scope of 329 and that an enforcement of the Section in these circumstances would discourage pre-petition attorneys from disclosing information to a debtor's bankruptcy attorney for fear of being subject to the disgorgement provision. However, a number of courts have determined that an attorney who is not a debtor's bankruptcy counsel may still be subject to the reporting requirements of Section 329 provided their services were "in contemplation" of bankruptcy. See Zepecki, 277 F.3d at 1046 (finding that an attorney who represented the debtor in a pre-petition real estate transaction was subject to Section 329); *365 Dixon, 143 B.R. at 677 (holding that an amount paid to an attorney for criminal defense services was subject to Section 329).
The bankruptcy court therefore incorrectly applied the statute in determining whether Miller's services were "in contemplation" of Garcia's bankruptcy filing. The court's emphasis on whether Miller may be considered one of Garcia's bankruptcy counsel is not the appropriate test for determining whether an attorney is subject to the requirements of Section 329. Instead, the court should determine whether Garcia's transactions with Miller were for the purpose of avoiding bankruptcy or were motivated by the imminence of bankruptcy. The court should determine whether Miller was in fact retained for the purpose of restructuring Garcia's debt or simply for short-selling a single property as Miller suggests. Moreover, because a determination of the debtor's state of mind as well as an ascertainment of the purpose of Miller's services are factual questions, and on account of the conflicting testimony contained in the record, the case is remanded to the bankruptcy court for a determination in accordance with the proper legal standard.

IV. CONCLUSION
I vacate the bankruptcy court's order and remand the case for a determination of whether Miller's services were provided in contemplation of bankruptcy as required by Section 329(a). Should the bankruptcy court find that Miller is subject to 329 it must then determine the amount Garcia actually paid to Miller and whether those fees were reasonable in light of the services provided.
NOTES
[1]  The disclosure required by Section 329(a) is made pursuant to FED. R. BANKR. P. 2016(b) which states that "[e]very attorney for a debtor, whether or not the attorney applies for compensation, shall file and transmit to the United States trustee within 14 days after the order for relief, or at another time as the court may direct, the statement required by § 329 of the Code . . ."
