Simplify code to handle TDS 4.2 metadata

We don't need to optimize this code that much

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>