refactoring for appium