Small refactoring

Small refactoring to remove code duplication (loop walking fields)