improve the code structure
change comments