rename `directory` to `is_dir`?