some cleanup of dynamic fields code