Some refactoring on Rule class.