Improve code structure of internal data generators