optimize maincontroller and update annotation.