Add rewrites for gadgets