Refactoring phantomJsSetup