revise logging and coding style