refactor code to use the new view locator