factor out options func into separate file