before changing the representation
added support for changing the type