Text this: Firms, contracts and financial structure