"White Heat" was meant to be based on the true story of Ma Barker, a bank robber who raised her four sons as criminals. However, this was changed along with Cagney's involvement; Ma Barker became Ma Jarrett, and her four children were reduced to two. Arthur Barker became Arthur "Cody" Jarrett, a psychopath with a mother fixation. Cody's mental illness and the exact cause of his migraines remain a mystery throughout the film. This was done intentionally, enabling viewers to use their imaginations and draw their own conclusions. In total, the script received several rewrites, with input being given from some of Cagney's closest friends. Humphrey Bogart and Frank McHugh worked "after hours" on revisions; with McHugh writing the film's opening scene.