Refactor apply/object rules

fixes #7700