Cleaning up how the stack resolves the directory