this looks weird; why not just use `basename` defined at L14?