move main process into class WebApplicatioin