Code generation for the common cases.