adjust code style and commenting