rename `dirname` to `dir` in phases