Simplify bookmarklet code