Remove some ugly code