CRM changes and rewrite plugin