add functions for struct generation