remove some ugly code