rewrite using enum and iterator