[mod] generation refactor