change coding style and add ut