make more efficient on broswer