move twitter JS to functions