Parse arg name. Some refactoring.
Generate type annotation for resolving rules.