DQ on optimal capital structure and dividends versus repurchase shares

Each response should be 300-500 words.
DQ 1: How would a financial manager determine optimal capital structure? How this would fit in with the company’s capital expenditures, growth plans and operating results?
DQ 2: In a “perfect world” capital market, how important is a firm’s decision to pay dividends versus repurchase shares? Under what conditions would you have a tax preference for share repurchase rather than dividends? Would managers acting in the interests of long-term shareholders be more likely to repurchase shares if they believed the stock to be either undervalued or overvalued?
Thanks,
W