fix up code around directories and filepaths