Dynamic conversion of string to a complex object