Refactoring code

Add a main process function that calls sub-process function such as _prepare_process, _process and _post_process