move formatOpts to own module