Make browser functions DRY with a macro