improved javascript code