Refactor rule visitor objects