complete main process framework