first detail retrieve try
refactor: xpath query moved to function