Refactoring old if / else parsing to using try_xpaths.