take out logic for custom fields with advanced data structures