adding detection of duplicate fields
moving top type into standalon enum; adding structure check to default value builder