Technical experience (with gassing and cremation) first gained with killing psychiatric patients was utilized later for the destruction of millions. The psychiatric murders came first.
Fredric Wertham Quotes
In 1941 the psychiatric institution Hadamar celebrated the cremation of the ten thousandth mental patient in a special ceremony. Psychiatrists, nurses, attendants, and secretaries all participated. Everybody received a bottle of beer for the occasion.