refactoring again to reduce Cyclomatic complexity in _entityinfo_get_field_info()