improve the code style and make small changes