refactored use of internal functions in get_fields()
removed unused flags