move spreadsheet genrator code into a common library