Refactor types.