Refactor on Protractor