rule refactoring: type rule