update function to current u_ nomenclature and allow AF_DIR env variable