Removed table generation from main code, moved it to tool.