small refactor of gen-data-class