Remove unused helpers. Add missing index on foreign keys.