DRY up the code a bit and apply it to all extensions