Finish refactoring - start adding rules.