work for all types of rules