Cleaning up extension code