fix some code style and consistency