Get rid of ugly code