implement atomic rules and rules factory