Cleanups to make the extension more generic