continue refine code and try to find out a framework for the application

continue refine code and try to find out a framework for the application