fix filling the cache
More DRY, add some formatting/line breaks

Remove the unused property "ownRules".