improve Main
some changes in Main class
improvemend of impl