A lot of functions could be made static in driver.c