moving rules to resources and altering tests to use ResourceFactory