Refacor main_helper.