remove debug code and change coding style