refactored to use xpath locators where possible