So we can't use dirname() to traverse up? The string manipulations are kind of verbose and ugly :/