Slightly less disgusting js