add type invariant and use for Init