use `path` methods instead of dumb str manips