refactor strong type rule