Refactoring rules

As suggested in #30.