Rename mode.targetPath to absolutePath and comment non-obvious stuff