Some changes to ease code generation