change some cases according to the feedback from showcase
organize the structure of code