Remove global vars in js