switching const and type