Extract function, changeType()