refactoring of Inspect._setup_fields