Factory generators for single and array