Reduce generate code