remove ugly logic