improved javascript editing