Added trim for rules