refact program