Refactor spreadsheet