Why is `basename` still called here - is it needed?