Factor out creating phantomjs command from poller event