same as before: use charAt + slice to get the type.