add Field struct and refactor