Use default values of fields to determine their types

Modify the code in order to simplify it