argh javascript is ugly