optimize phantom js usage