LPS-46748 Replace tuples and Maps by Objects to make the code more robust