Simplified the get_fields() function.