separate casting of arrays from internal values