Refactored xpath evaluate calls